package com.daiyang.librarymanagementsystem2.controller_test;

import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;

@Controller
public class UserController {

    private  UserSevice userService;
//    @Qualifier("u1")
//    @Autowired
    @Resource(name="user2")
    private User user;
   //@Autowired
    public UserController(UserSevice userService) {
        this.userService = userService;
    }
    public UserController() {

    }
   // @Autowired
//    public void setUserService(UserSevice userService) {
//        this. userService = userService;
//    }
//    private String name ;
//    private Integer password;
    public void sayHello() {
        System.out.println(user);

    }
//   public void sayHello2() {
//        System.out.println(name);
//        System.out.println(password);
//    }
//
//    public UserController(String name, Integer password) {
//        this.name = name;
//        this.password = password;
//    }
//    public UserController( Integer password,String name) {
//        this.name = name;
//        this.password = password;
//    }

}
